<template>
  <div>
    <!-- 值班打印 2018/3/7 11:44 zhangQ -->
    <Row>
      <i-col span="16" offset="4">
        <Form ref="dutyForm" :model="dutyForm" label-position="left" :label-width="100">

          <FormItem label="提煤单票据类型" prop="coalBillType">
            <Input type="text" v-model="dutyForm.coalBillType"></Input>
          </FormItem>
          <FormItem label="送货地址" prop="address">
            <Input type="text" v-model="dutyForm.address"></Input>
          </FormItem>
        </Form>
      </i-col>
    </Row>
    <div class="xlinkModal-footer">
      <Button type="primary" @click="setCoalNo">确认操作</Button>
      <!--<Button type="primary" @click="printCoalNo">打印</Button>-->
    </div>
  </div>
</template>

<script>
  import { saveCoalBillType } from '@api/backEnd/station'
  // import printUtils from '@/components/print/index'

  export default {
    name: 'duty-opera-modal',
    data () {
      let dutyForm = { coalBillType: '', address: '', orderNos: this.orderData }
      let datas = { dutyForm }
      return datas
    },
    computed: {},
    props: {
      orderData: {
        type: Array,
        default () {
          return {}
        }
      }
    },
    methods: {
      setCoalNo () {
        if (!this.dutyForm.coalBillType) {
          this.$Message.warning('请填写提煤单票据类型!')
          return false
        }
        console.log('提煤单票据类型', this.dutyForm)
        let param = Object.assign({}, this.dutyForm)
        saveCoalBillType(param).then((res) => {
          if (+res.data.isSuccess === 1) {
            this.$Message.success('发布成功')
            this.$emit('close', this.dutyForm)
          } else {
            this.$Notice.error({
              title: '操作失败',
              desc: res.data.res,
              duration: 2
            })
          }
        })
      },
      printCoalNo (row) {
        // printUtils.print({
        //   titile: '打印提煤单号',
        //   template: '驱蚊器翁'
        // })
        this.$emit('print')
      }
    },
    created () {
    },
    mounted () {
    },
    components: {}
  }
</script>

<style scoped>

</style>
